Typing Context-Dependent Behavioural Variation
نویسندگان
چکیده
Context Oriented Programming (COP) concerns the ability of programs to adapt to changes in their running environment. A number of programming languages endowed with COP constructs and features have been developed. However, some foundational issues remain unclear. This paper proposes adopting static analysis techniques to reason on and predict how programs adapt their behaviour. We introduce a core functional language, ContextML, equipped with COP primitives for manipulating contexts and for programming behavioural variations. In particular, we specify the dispatching mechanism, used to select the program fragments to be executed in the current active context. Besides the dynamic semantics we present an annotated type system. It guarantees that the well-typed programs adapt to any context, i.e. the dispatching mechanism always succeeds at run-time.
منابع مشابه
Typing Context-Dependent Behavioural Variations
Context Oriented Programming (COP) is a hot topic nowadays. A number of programming languages endowed with COP features has been developed. However, some foundational issues remain unclear. This paper proposes adopting static analysis techniques to predict how programs may react in different execution environments. We introduce a core functional language, ContextML, equipped with COP primitives...
متن کاملContext-dependent female mate choice maintains variation in male sexual activity
The existence of individual variation in males' motivation to mate remains a conundrum as directional selection should favour high mating frequencies. Balancing selection resulting from (context-dependent) female mate choice could contribute to the maintenance of this behavioural polymorphism. In dichotomous choice tests, mosquitofish (Gambusia holbrooki) females preferred virtual males showing...
متن کاملAn explanatory framework for adaptive personality differences.
We develop a conceptual framework for the understanding of animal personalities in terms of adaptive evolution. We focus on two basic questions. First, why do behavioural types exhibit limited behavioural plasticity, that is, behavioural correlations both across contexts and over time? Second, how can multiple behavioural types coexist within a single population? We emphasize differences in 'st...
متن کاملStrongly-Typed Theory of Structures and Behaviours
This paper describes an approach to capturing the relation between circuits and their behaviours within a formal theory. The method exploits dependent types to achieve a rigorous yet theoretically simple connection between circuits (treated as graphs) and their behavioural speciications (treated as predicates). An example is given of a behavioural extraction function and it is shown how a type ...
متن کاملDagstuhl Seminar 17051 Theory and Applications of Behavioural Types
This report documents the programme and the outcomes of Dagstuhl Seminar 17051 “Theory and Applications of Behavioural Types”. Behavioural types describe the dynamic aspects of programs, in contrast to data types, which describe the fixed structure of data. Perhaps the most well-known form of behavioural types is session types, which are type-theoretic specifications of communication protocols....
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2012